/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.todoterreno.datamodel;


import com.todoterreno.model.CasaTerrenoVertical;
import com.todoterreno.model.Venta;
import com.todoterreno.utils.PrimeDataModel;
import java.util.List;

/**
 *
 * @author davex
 */
public class VentaDataModel extends PrimeDataModel<Venta> {

    public VentaDataModel() {
    }

    public VentaDataModel(Object data) {
        super(data);
    }
    
    @Override
    public Venta getRowData(String rowKey) {
        //In a real app, a more efficient way like a query by rowKey should be implemented to deal with huge data

        List<Venta> listv = (List<Venta>) getWrappedData();

        for (Venta v : listv) {
            if (v.getIdVenta().equals(rowKey)) {
//            if (proy.getCodproy().equals(rowKey)) {
                return v;
            }
        }

        return null;
    }


    @Override
    public String getRowKey(Venta v) {
        return v.getIdVenta();
//        return proy.getCodproy();
    }
    
}
